<template>
    <base-dialog  v-bind="$attrs" v-on="$listeners" :title="title" size="tiny" @submit="toAdd" :disabled="disabled">
        <el-form  ref="elForm" label-width="100px" :model="formData" :rules="rules" :disabled="disabled">
          <el-form-item label="名称" prop="name">
            <el-input v-model="formData.name"></el-input>
          </el-form-item>
          <el-form-item label="上级部门" prop="parent_dept">
            <dept-select-tree dept-type="all"  v-model="formData.parent_dept"  :show-count="true"  placeholder="请选择父级栏目" :disabled="disabled"></dept-select-tree>
          </el-form-item>
          <el-form-item label="排序" prop="no_order">
            <el-input-number
              v-model.number="formData.no_order"
              placeholder="请输入排序"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input-number>
          </el-form-item>
          <el-form-item label="标签" prop="label">
            <el-input v-model="formData.label"></el-input>
          </el-form-item>
          <el-form-item label="状态" prop="status">
            <dict-radio v-model="formData.status" distKey="button_status_bool"></dict-radio>
          </el-form-item>
        </el-form>
    </base-dialog>
</template>
<script>
    import BaseDialog from "@/components/Common/BaseDialog";
    import DetailDialog from "@/mixins/DetailDialog";
    import DeptSelectTree from '@/components/Common/DeptSelectTree'
    import DictRadio from '../../../components/DictRadio/index'
    export default {
        name:"DetailDialog",
        mixins:[DetailDialog],
        data(){
          return {
              formData:{
                name: "",
                approver: "",
                label: "",
                leader: "",
                parent_dept: undefined,
                secretary:undefined,
                status:true,
                no_order:0

              },
              rules:{
                name: {
                  required: true,
                  message: "请输入名称",
                  trigger: "blur"
                }
              },
              userList:[],
              loading:false,
          }
        },
        created() {
        },
        components: { DictRadio, DeptSelectTree, BaseDialog},
        computed:{
            title() {
                return this.disabled?'查看':this.formData.id?"编辑":"新增"
            },
        },
        methods:{
        }
    }
</script>
